package com.lg.java.jmm;

public class StrTest {
    public static void main(String[] args) {
        String s0 = "s1";
        String s1 = "s1";

        String s2 = new String("s1");
        String s3 = s2.intern();

        System.out.println(s0 == s1);   //true
        System.out.println(s1 == s2);   //false
        System.out.println(s2 == s3);   //false
        System.out.println(s3 == s0);   //true
    }
}
